Use the phrase in a nutshell when you want to make it clear that you're going to sum something up in just a few words. Another way to say this would be "to make a long story short."
If you don't want to tell your friend the whole long complicated story about how your hair came to be dyed purple instead of blonde, you can sum it up by saying, "In a nutshell, I bought the wrong hair dye." Shakespeare may have been one of the first to use a nutshell as a metaphor for something small, and by the 1800's the phrase in a nutshell became commonly used to mean "in a small number of words."